<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.List" %>
<%@ page import="oneroom.admin.oneroom.roomModel" %>
<%@ page import="oneroom.admin.code.codeModel" %>
<jsp:useBean id="dao" scope="page" class="oneroom.admin.oneroom.roomDao" />
<jsp:useBean id="codeDao" scope="page" class="oneroom.admin.code.codeDao" />
<%
	String redirectUrl = "";
	String id = "";
	if (session.getAttribute("id") != null &&
		((String)session.getAttribute("id")).equals("") == false) {
		id = (String)session.getAttribute("id");
	} else {
		redirectUrl = "/room/member/login.jsp";
		response.sendRedirect(redirectUrl);
	}
	String	grade	= (String)session.getAttribute("grade") == null ? "" : (String)session.getAttribute("grade");
	
	List subwayList	= codeDao.getDtlList("001");// 지하철
	List heatingList= codeDao.getDtlList("300");// 난방 시설
	List airconditioningList= codeDao.getDtlList("301");// 냉방 시설
	List university1List= codeDao.getDtlList("400");// 대학교 지역
	List roomnumberList	= codeDao.getDtlList("500");// 매물 종류
	List furnitureList	= codeDao.getDtlList("302");// 가구
	List appliancesList	= codeDao.getDtlList("303");//가전
	List kitchenList	= codeDao.getDtlList("304"); //주방
	List securityList	= codeDao.getDtlList("305"); //무료
	//List facilityList	= codeDao.getDtlList("306"); //주변시설
	
	int giRecordcnt = dao.getMyCount(id); 			// 총 list 수
	
	int tot_cnt = 0;
	if(grade.equals("2")){
		tot_cnt = 500;
	}else if(grade.equals("3")){
		tot_cnt = 100;
	}else if(grade.equals("4")){
		tot_cnt = 50;
	}else if(grade.equals("5")){
		tot_cnt = 10;
	}else if(grade.equals("6")){
		tot_cnt = 1;		
	}
	roomModel model;
	String oneroom_seq = request.getParameter("oneroom_seq") == null ? "" : request.getParameter("oneroom_seq");
	String gubun = request.getParameter("gubun") == null ? "" : request.getParameter("gubun");
	if (oneroom_seq != ""){
		 model = dao.getView(oneroom_seq);	
	}else{
		 model = new roomModel();	
	}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>원룸몬스터</title>

<link href="/room/css/all.css" rel="stylesheet" type="text/css" />
<script src="/room/script/swfobject_modified.js" type="text/javascript"></script>
<script src="/room/script/common.js" type="text/javascript"></script>
<script src="/room/script/jquery-1.3.2.min.js" type="text/javascript" ></script>
<script type="text/javascript" src="/editor/editor.js"></script>
<script type="text/javascript">
<!--
$(document).ready(function(){
	
	$('#btList').click(function() {
		window.location.href="room_list.jsp";
	});
	$('#zip_code').click(function() {
		window.open('/room/common/zipcode.jsp', 'zipcode','scrollbars=yes, height=400px,width=440px');
	});
	$('#address1').click(function() {
		window.open('/room/common/zipcode.jsp', 'zipcode','scrollbars=yes, height=400px,width=440px');
	});
	$('#address2').click(function() {
		window.open('/room/common/zipcode.jsp', 'zipcode','scrollbars=yes, height=400px,width=440px');
	});
	$('#address3').click(function() {
		window.open('/room/common/zipcode.jsp', 'zipcode','scrollbars=yes, height=400px,width=440px');
	});
	$('#address4').click(function() {
		window.open('/room/common/zipcode.jsp', 'zipcode','scrollbars=yes, height=400px,width=440px');
	});
	$('#address5').click(function() {
		window.open('/room/common/zipcode.jsp', 'zipcode','scrollbars=yes, height=400px,width=440px');
	});
	$('#zipcode1').click(function() {
		window.open('/room/common/zipcode.jsp', 'zipcode','scrollbars=yes, height=400px,width=440px');
	});
	$('#zipcode2').click(function() {
		window.open('/room/common/zipcode.jsp', 'zipcode','scrollbars=yes, height=400px,width=440px');
	});
	$.ajax({type : "post",
		url : "/room/common/subway.jsp",
		dataType : "html",
		data : "maincode=<%=model.getSubway1()%>&dtlcode=<%=model.getSubway2()%>",
		success : function(msg){
			document.getElementById("divSubWay2").innerHTML = msg;
		}
	});
	<%if(gubun.equals("CI")){ %>
	$.ajax({type : "post",
		url : "/room/common/university2.jsp",
		dataType : "html",
		data : "maincode=<%=model.getUniversity1()%>&dtlcode=<%=model.getUniversity2()%>",
		success : function(msg){
			document.getElementById("divuniversity2").innerHTML = msg;
		}
	});
	<%}%>	
	$('#subway1').change(function() {
		$.ajax({type : "post",
			url : "/room/common/subway.jsp",
			dataType : "html",
			data : "maincode="+document.getElementById("subway1").value,
			success : function(msg){
				document.getElementById("divSubWay2").innerHTML = msg;
			}
		});
	});

	$('#university1').change(function() {
		$.ajax({type : "post",
			url : "/room/common/university2.jsp",
			dataType : "html",
			data : "maincode="+document.getElementById("university1").value,
			success : function(msg){
				document.getElementById("divuniversity2").innerHTML = msg;
			}
		});
	});
	
	
	
});
function goWrite(obj){
	var frm = document.frm;
	var str = 0;
	<%if (tot_cnt == giRecordcnt || tot_cnt < giRecordcnt){ %>
		alert("더 이상 매물을 등록 할 수 없습니다");
		window.location.href="room_list.jsp";
		return;
	<%}%>

	frm.content.value = edit_frame.EditorCtrl.document.body.innerHTML;	


	if(frm.address1.value == "" || frm.address2.value == "" || frm.address3.value == "" || frm.address4.value == ""){
		alert("주소를 입력하십시오.");
		return;
	}
	for(i=0;i<frm.roomkind.length;i++ ){
		if(frm.roomkind[i].checked){
			str = 1;
		}
	}
	if(str == 0){
		alert("매물종류를 선택하십시오.");
		return;
	}	
	if(frm.roomarea.value == ""){
		alert("평수를 입력하십시오.");
		frm.roomarea.focus(); 
		return;
	}
	if(frm.roommoney.value == "" && (frm.roommonth1.value=="" ||frm.roommonth2.value=="") ){
		alert("전/월세중 하나는 입력하셔야합니다.");
		frm.roommoney.focus(); 
		return;
	}
	if(frm.title.value == ""){
		alert("제목을 입력하십시오.");
		frm.title.focus(); 
		return;
	}
	if(frm.content.value == ""){
		alert("내용을 입력 하십시요.");
		return;
	}
	if(frm.tel1.value == "" || frm.tel2.value == "" || frm.tel3.value == ""){
		alert("연락처를 입력하십시오.");
		return;
	}	
	if(frm.photo1.value == "" && (frm.photo2.value != "" || frm.photo3.value != "" || frm.photo4.value != "" || frm.photo5.value != "" || frm.photo6.value != "")){
		alert("첫번째 이미지부터 등록하십시오.");
		frm.photo1.focus(); 
		return;
	}else if(frm.photo1.value == ""){
		alert("하나 이상의 이미지를 등록하십시오.");
		frm.photo1.focus(); 
		return;
	}	
	if(obj == "I"){
		frm.gubun.value="I";
	}else{
		frm.gubun.value="CI";		
	}
	frm.submit();
}

function display(no){
    for(var i=1; i<=2; i++){
        document.getElementById("charter_type"+i).style.display="none";
    }
    document.getElementById("charter_type"+no).style.display="block";
    if(no == "2"){
    	document.getElementById("charter_name").innerHTML = "월세";
    }else{
    	document.getElementById("charter_name").innerHTML = "전세";
    }
}


	function getYearSelect() {
	   var today = new Date();
	   
	  for(i=today.getFullYear();i < today.getFullYear()+10; i++) {
	   if(today.getFullYear() != i) {
	    document.write('<option value="'+i+'">'+i);
	   } else {
	    document.write('<option value="'+i+'" selected>'+i);
	   }
	  }
	 }

	// 월별 selectbox 만들기
	function getMonSelect() {
	   var today = new Date();  
	    for(var i=1; i<=12; i++) {
	       if(today.getMonth()+1 != i) {
	           document.write('<option value="'+i+'">'+i);
	       } else {
	            document.write('<option value="'+i+'" selected>'+i);
	      }
	    }
	 } 
	 // 일별 selectbox 만들기 
	function getDaySelect() { 
	  var today = new Date();  

	  for(var i=1; i<=31; i++) { 
	  if(today.getDate() != i) { 
	    document.write('<option value="'+i+'">'+i); 
	  } else { 
	    document.write('<option value="'+i+'" selected>'+i); 
	  } 
	  } 
	 } 	 
//-->
</script>	
</head>

 
<body onload="display('<%=model.getCharter()=="J"? "1":"2"%>');">
<div align="center"> 

 <div id="content">

<!----------------왼쪽---------------->  
<%@ include file="/room/common/left.jsp" %>
<!----------------왼쪽끝---------------->  


<!----------------가운데 시작----------------> 
 <div id="rgt">
  <div id="con01">
   <div class="top bb1"><img src="/room/img/txt_top.gif" /></div>
   <div id="sch-adress"></div>
   
<div class="list">
 <div class="pb10"><img src="/room/img/line_blue.gif" width="32" height="2" /></div>
      <div class="pb20"><span style="font-size:11px;">Home >회원> <span style="color:#000;">마이페이지</span></span></div>
      <div> 
       <div class="tit">my 매물리스트 </div>   	
      </div>
      
     <!---------------- 내용시작----------------> 
				<form action="room_dbx.jsp" name="frm" id="frm" method="post" enctype="multipart/form-data"> 
				<input type="hidden" name="gubun" value="" />
				<input type="hidden" name="content" />				
				<!-- 실제적인 리스트 시작 -->
				<div class="list">
				<table  width="167" border="0" cellspacing="0" cellpadding="0">
				  <tr>
				    <td><p class="btn_b87" id="tap03">기본정보</p></td>
				  </tr>
				</table> 				
				<table width="565" border="0" cellspacing="0" cellpadding="0">
				<col width="15%" />
				<col width="40%" />
				<col width="15%" />
				<col width="30%" />
				  <tr>
				    <td class="ac fw bt2 bb1 h30 bg_g">주소</td>
				    <td colspan="3" class="bt2 bb1 h30 pl10 ">
					<input name="address1" id="address1" value="<%=model.getAddress1() %>" title="주소 입력" type="text"  style="width:40px;"  readonly="readonly" />
					<input name="address2" id="address2" value="<%=model.getAddress2() %>" title="주소 입력" type="text"  style="width:40px;"  readonly="readonly" />
					<input name="address3" id="address3" value="<%=model.getAddress3() %>" title="주소 입력" type="text"  style="width:60px;"  readonly="readonly" />
					<input name="address4" id="address4" value="<%=model.getAddress4() %>" title="주소 입력" type="text"  style="width:60px;"  readonly="readonly" />
					<input name="address5" id="address5" value="<%=model.getAddress5() %>" title="주소 입력" type="text"  style="width:150px;"  readonly="readonly" />
					<input type="hidden" name="zipcode1" id="zipcode1">
					<input type="hidden" name="zipcode2" id="zipcode2">
					<!-- 
				    <td class="ac fw bt2 bb1 h30 bg_g">우편번호</td>
				    <td class="bt2 bb1 h30 pl10 ">
					<input name="zipcode1" id="zipcode1" value="<%//=model.getZipcode1() %>" title="주소 입력" type="text"  style="width:30px;"  readonly="readonly" />
					~ <input name="zipcode2" id="zipcode2" value="<%//=model.getZipcode2() %>" title="주소 입력" type="text"  style="width:30px;"  readonly="readonly" />
					<a class="d" href="#" id="zip_code"><div class="btn_b67">주소검색</div></a>
					</td> -->				
				    </tr>
				  <tr>
				    <td class="ac fw bb1 h30 bg_g">방수</td>
				    <td class=" bb1 h30 pl10">
					<select name="roomnumber" style="width:50px;">
						<option value="1" <%if (model.getRoomnumber().equals("1")){ %>selected="selected"<%} %>>1</option>
						<option value="2" <%if (model.getRoomnumber().equals("2")){ %>selected="selected"<%} %>>2</option>
						<option value="3" <%if (model.getRoomnumber().equals("3")){ %>selected="selected"<%} %>>3</option>
						<option value="4" <%if (model.getRoomnumber().equals("4")){ %>selected="selected"<%} %>>4</option>
						<option value="5" <%if (model.getRoomnumber().equals("5")){ %>selected="selected"<%} %>>5</option>
						<option value="6" <%if (model.getRoomnumber().equals("6")){ %>selected="selected"<%} %>>6</option>
						<option value="7" <%if (model.getRoomnumber().equals("7")){ %>selected="selected"<%} %>>7</option>
						<option value="8" <%if (model.getRoomnumber().equals("8")){ %>selected="selected"<%} %>>8</option>
						<option value="9" <%if (model.getRoomnumber().equals("9")){ %>selected="selected"<%} %>>9</option>
						<option value="10" <%if (model.getRoomnumber().equals("10")){ %>selected="selected"<%} %>>10</option>
					</select> 개				    
					</td>
				     <td class="ac fw bb1 h30 bg_g">매물종류</td>
				    <td class="ac bb1" style="text-align: left;padding:5px;">
					<%
						for(int i = 0; i < roomnumberList.size(); i++){
							codeModel mode = (codeModel)roomnumberList.get(i);
					%>
					<input type="radio" name="roomkind" value="<%=mode.getCode() %>" <%if(model.getRoomkind().equals(mode.getCode()) || i==0){ %>checked="checked" <%} %>/> <%=mode.getCodename() %>
					<%if(((i+1)%2) == 0 && i > 0) {%>
					<br/>
					<%} %>
					<%
						}
					%>				    
					</td>
				  </tr>
				  <tr>
				    <td class="ac fw bb1 h30 bg_g">평수</td>
				    <td class=" bb1 h30 pl10">
					<input name="roomarea" id="roomarea" value="<%=model.getRoomarea() %>" title="평수" type="text"  style="width:50px;" /> 평
					</td>
				    <td class="ac fw bb1 h30 bg_g">임대형태</td>
				    <td class="bb1 h30 pl10">
				    <input type="radio" name="charter" value="J" <%if(model.getCharter().equals("J")){%>checked="checked"<%} %> onclick="display('1');"/>전세 
					<input type="radio" name="charter" value="W" <%if(model.getCharter().equals("W") || model.getCharter().equals("") ){%>checked="checked"<%} %> onclick="display('2');"/>월세
					</td>
				  </tr>
				  <tr>
				    <td class="ac fw bb1 h30 bg_g">층</td>
				    <td class=" bb1 h30 pl10">
								<select name="roomfloor1" style="width:50px;">
									<option value="1" <%if (model.getRoomfloor1().equals("1")){ %>selected="selected"<%} %>>1층</option>
									<option value="2" <%if (model.getRoomfloor1().equals("2")){ %>selected="selected"<%} %>>2층</option>
									<option value="3" <%if (model.getRoomfloor1().equals("3")){ %>selected="selected"<%} %>>3층</option>
									<option value="4" <%if (model.getRoomfloor1().equals("4")){ %>selected="selected"<%} %>>4층</option>
									<option value="5" <%if (model.getRoomfloor1().equals("5")){ %>selected="selected"<%} %>>5층</option>
									<option value="6" <%if (model.getRoomfloor1().equals("6")){ %>selected="selected"<%} %>>6층</option>
									<option value="7" <%if (model.getRoomfloor1().equals("7")){ %>selected="selected"<%} %>>7층</option>
									<option value="8" <%if (model.getRoomfloor1().equals("8")){ %>selected="selected"<%} %>>8층</option>
									<option value="9" <%if (model.getRoomfloor1().equals("9")){ %>selected="selected"<%} %>>9층</option>
									<option value="10" <%if (model.getRoomfloor1().equals("10")){ %>selected="selected"<%} %>>10층</option>
									<option value="11" <%if (model.getRoomfloor1().equals("11")){ %>selected="selected"<%} %>>11층</option>
									<option value="12" <%if (model.getRoomfloor1().equals("12")){ %>selected="selected"<%} %>>12층</option>
									<option value="13" <%if (model.getRoomfloor1().equals("13")){ %>selected="selected"<%} %>>13층</option>
									<option value="14" <%if (model.getRoomfloor1().equals("14")){ %>selected="selected"<%} %>>14층</option>
									<option value="15" <%if (model.getRoomfloor1().equals("15")){ %>selected="selected"<%} %>>15층</option>
									<option value="16" <%if (model.getRoomfloor1().equals("16")){ %>selected="selected"<%} %>>16층</option>
									<option value="17" <%if (model.getRoomfloor1().equals("17")){ %>selected="selected"<%} %>>17층</option>
									<option value="18" <%if (model.getRoomfloor1().equals("18")){ %>selected="selected"<%} %>>18층</option>
									<option value="19" <%if (model.getRoomfloor1().equals("19")){ %>selected="selected"<%} %>>19층</option>
									<option value="20" <%if (model.getRoomfloor1().equals("20")){ %>selected="selected"<%} %>>20층</option>
									<option value="21" <%if (model.getRoomfloor1().equals("21")){ %>selected="selected"<%} %>>21층</option>
									<option value="22" <%if (model.getRoomfloor1().equals("22")){ %>selected="selected"<%} %>>22층</option>
									<option value="23" <%if (model.getRoomfloor1().equals("23")){ %>selected="selected"<%} %>>23층</option>
									<option value="24" <%if (model.getRoomfloor1().equals("24")){ %>selected="selected"<%} %>>24층</option>
									<option value="25" <%if (model.getRoomfloor1().equals("25")){ %>selected="selected"<%} %>>25층</option>
									<option value="26" <%if (model.getRoomfloor1().equals("26")){ %>selected="selected"<%} %>>26층</option>
									<option value="27" <%if (model.getRoomfloor1().equals("27")){ %>selected="selected"<%} %>>27층</option>
									<option value="28" <%if (model.getRoomfloor1().equals("28")){ %>selected="selected"<%} %>>28층</option>
									<option value="29" <%if (model.getRoomfloor1().equals("29")){ %>selected="selected"<%} %>>29층</option>
									<option value="30" <%if (model.getRoomfloor1().equals("30")){ %>selected="selected"<%} %>>30층</option>
									<option value="31" <%if (model.getRoomfloor1().equals("31")){ %>selected="selected"<%} %>>31층</option>
									<option value="32" <%if (model.getRoomfloor1().equals("32")){ %>selected="selected"<%} %>>31층</option>
									<option value="33" <%if (model.getRoomfloor1().equals("33")){ %>selected="selected"<%} %>>33층</option>
									<option value="34" <%if (model.getRoomfloor1().equals("34")){ %>selected="selected"<%} %>>34층</option>
									<option value="35" <%if (model.getRoomfloor1().equals("35")){ %>selected="selected"<%} %>>35층</option>
									<option value="36" <%if (model.getRoomfloor1().equals("36")){ %>selected="selected"<%} %>>36층</option>
									<option value="37" <%if (model.getRoomfloor1().equals("37")){ %>selected="selected"<%} %>>37층</option>
									<option value="38" <%if (model.getRoomfloor1().equals("38")){ %>selected="selected"<%} %>>38층</option>
									<option value="39" <%if (model.getRoomfloor1().equals("39")){ %>selected="selected"<%} %>>39층</option>
									<option value="40" <%if (model.getRoomfloor1().equals("40")){ %>selected="selected"<%} %>>40층</option>
								</select> / 
								<select name="roomfloor2" style="width:50px;">
									<option value="1" <%if (model.getRoomfloor2().equals("1")){ %>selected="selected"<%} %>>1층</option>
									<option value="2" <%if (model.getRoomfloor2().equals("2")){ %>selected="selected"<%} %>>2층</option>
									<option value="3" <%if (model.getRoomfloor2().equals("3")){ %>selected="selected"<%} %>>3층</option>
									<option value="4" <%if (model.getRoomfloor2().equals("4")){ %>selected="selected"<%} %>>4층</option>
									<option value="5" <%if (model.getRoomfloor2().equals("5")){ %>selected="selected"<%} %>>5층</option>
									<option value="6" <%if (model.getRoomfloor2().equals("6")){ %>selected="selected"<%} %>>6층</option>
									<option value="7" <%if (model.getRoomfloor2().equals("7")){ %>selected="selected"<%} %>>7층</option>
									<option value="8" <%if (model.getRoomfloor2().equals("8")){ %>selected="selected"<%} %>>8층</option>
									<option value="9" <%if (model.getRoomfloor2().equals("9")){ %>selected="selected"<%} %>>9층</option>
									<option value="10" <%if (model.getRoomfloor2().equals("10")){ %>selected="selected"<%} %>>10층</option>
									<option value="11" <%if (model.getRoomfloor2().equals("11")){ %>selected="selected"<%} %>>11층</option>
									<option value="12" <%if (model.getRoomfloor2().equals("12")){ %>selected="selected"<%} %>>12층</option>
									<option value="13" <%if (model.getRoomfloor2().equals("13")){ %>selected="selected"<%} %>>13층</option>
									<option value="14" <%if (model.getRoomfloor2().equals("14")){ %>selected="selected"<%} %>>14층</option>
									<option value="15" <%if (model.getRoomfloor2().equals("15")){ %>selected="selected"<%} %>>15층</option>
									<option value="16" <%if (model.getRoomfloor2().equals("16")){ %>selected="selected"<%} %>>16층</option>
									<option value="17" <%if (model.getRoomfloor2().equals("17")){ %>selected="selected"<%} %>>17층</option>
									<option value="18" <%if (model.getRoomfloor2().equals("18")){ %>selected="selected"<%} %>>18층</option>
									<option value="19" <%if (model.getRoomfloor2().equals("19")){ %>selected="selected"<%} %>>19층</option>
									<option value="20" <%if (model.getRoomfloor2().equals("20")){ %>selected="selected"<%} %>>20층</option>
									<option value="21" <%if (model.getRoomfloor2().equals("21")){ %>selected="selected"<%} %>>21층</option>
									<option value="22" <%if (model.getRoomfloor2().equals("22")){ %>selected="selected"<%} %>>22층</option>
									<option value="23" <%if (model.getRoomfloor2().equals("23")){ %>selected="selected"<%} %>>23층</option>
									<option value="24" <%if (model.getRoomfloor2().equals("24")){ %>selected="selected"<%} %>>24층</option>
									<option value="25" <%if (model.getRoomfloor2().equals("25")){ %>selected="selected"<%} %>>25층</option>
									<option value="26" <%if (model.getRoomfloor2().equals("26")){ %>selected="selected"<%} %>>26층</option>
									<option value="27" <%if (model.getRoomfloor2().equals("27")){ %>selected="selected"<%} %>>27층</option>
									<option value="28" <%if (model.getRoomfloor2().equals("28")){ %>selected="selected"<%} %>>28층</option>
									<option value="29" <%if (model.getRoomfloor2().equals("29")){ %>selected="selected"<%} %>>29층</option>
									<option value="30" <%if (model.getRoomfloor2().equals("30")){ %>selected="selected"<%} %>>30층</option>
									<option value="31" <%if (model.getRoomfloor2().equals("31")){ %>selected="selected"<%} %>>31층</option>
									<option value="32" <%if (model.getRoomfloor2().equals("32")){ %>selected="selected"<%} %>>31층</option>
									<option value="33" <%if (model.getRoomfloor2().equals("33")){ %>selected="selected"<%} %>>33층</option>
									<option value="34" <%if (model.getRoomfloor2().equals("34")){ %>selected="selected"<%} %>>34층</option>
									<option value="35" <%if (model.getRoomfloor2().equals("35")){ %>selected="selected"<%} %>>35층</option>
									<option value="36" <%if (model.getRoomfloor2().equals("36")){ %>selected="selected"<%} %>>36층</option>
									<option value="37" <%if (model.getRoomfloor2().equals("37")){ %>selected="selected"<%} %>>37층</option>
									<option value="38" <%if (model.getRoomfloor2().equals("38")){ %>selected="selected"<%} %>>38층</option>
									<option value="39" <%if (model.getRoomfloor2().equals("39")){ %>selected="selected"<%} %>>39층</option>
									<option value="40" <%if (model.getRoomfloor2().equals("40")){ %>selected="selected"<%} %>>40층</option>
								</select>
					</td>
				    <td class="ac fw bb1 h30 bg_g"><span id="charter_name">전세</span></td>
				    <td class="bb1 h30  pl10">
					<div id="charter_type1"  style="display: block;">
					<input name="roommoney" id="roommoney" value="<%=model.getRoommoney() %>" title="전세금" type="text"  style="width:50px;" /> 만원
					</div>
					<div id="charter_type2"  style="display: none;">
					보증 : <input name="roommonth1" id="roommonth1" value="<%=model.getRoommonth1() %>" title="월세 보증금" type="text"  style="width:50px;" /> 만원 /<br/> 
					월세 : <input name="roommonth2" id="roommonth2" value="<%=model.getRoommonth2() %>" title="월세금" type="text"  style="width:50px;" /> 만원
					</div>					
					</td>
				  </tr>
				  <tr>
				    <td class="ac fw bb1 h30 bg_g">주차</td>
				    <td class=" bb1 h30 pl10">
					<select name="car" style="width:50px;">
						<option value="1" <%if (model.getCar().equals("1")){ %>selected="selected"<%} %>>1</option>
						<option value="2" <%if (model.getCar().equals("2")){ %>selected="selected"<%} %>>2</option>
						<option value="3" <%if (model.getCar().equals("3")){ %>selected="selected"<%} %>>3</option>
						<option value="4" <%if (model.getCar().equals("4")){ %>selected="selected"<%} %>>4</option>
						<option value="5" <%if (model.getCar().equals("5")){ %>selected="selected"<%} %>>5</option>
						<option value="6" <%if (model.getCar().equals("6")){ %>selected="selected"<%} %>>6</option>
						<option value="7" <%if (model.getCar().equals("7")){ %>selected="selected"<%} %>>7</option>
						<option value="8" <%if (model.getCar().equals("8")){ %>selected="selected"<%} %>>8</option>
						<option value="9" <%if (model.getCar().equals("9")){ %>selected="selected"<%} %>>9</option>
						<option value="10" <%if (model.getCar().equals("10")){ %>selected="selected"<%} %>>10</option>
					</select> 대
					</td>
				    <td class="ac fw bb1 h30 bg_g">관리비</td>
				    <td class="bb1 h30 pl10 ">
					<input name="managemoney" id="managemoney" value="<%=model.getManagemoney() %>" title="관리비" type="text"  style="width:80px;" /> 만원
					</td>				    
				  </tr>
				  <tr>
				    <td class="ac fw bb1 h30 bg_g">거래방식</td>
				    <td colspan="3" class="bb1 h30 pl10 ">
					<select name="roomoption" id="roomoption" style="width:80px;">
						<option value="">선택</option>
						<option value="G" >일반중개</option>
						<option value="M" >반값중개</option>
						<option value="D" >직거래</option>								
					</select>
				  </tr>					  
				  <tr>
				    <td class="ac fw bb1 h30 bg_g">지하철</td>
				    <td colspan="3" class="bb1 h30 pl10 ">
					<select name="subway1" id="subway1" style="width:80px;">
						<option value="">선택</option>
					<%
						for(int i = 0; i < subwayList.size(); i++){
							codeModel mode = (codeModel)subwayList.get(i);
					%>
					<option value="<%=mode.getCode() %>" <%if(mode.getCode().equals(model.getSubway1())){out.print(" selected='selected' ");} %>><%=mode.getCodename() %></option>					
					<%
						}
					%>
					</select>
					&nbsp;
					<span id="divSubWay2">
					<select name="subway2" style="width:80px;">
						<option value="">선택</option>
					</select>
					</span>
					&nbsp;
					<select name="subway3" style="width:80px;">
						<option value="">선택</option>					
						<option value="5" <%if(model.getSubway3().equals("5분거리")){out.print(" selected='selected' ");} %> >5분거리</option>
						<option value="10" <%if(model.getSubway3().equals("10분거리")){out.print(" selected='selected' ");} %> >10분거리</option>
						<option value="15" <%if(model.getSubway3().equals("15분거리")){out.print(" selected='selected' ");} %> >15분거리</option>
						<option value="20" <%if(model.getSubway3().equals("20분거리")){out.print(" selected='selected' ");} %> >20분거리</option>
						<option value="25" <%if(model.getSubway3().equals("25분거리")){out.print(" selected='selected' ");} %> >25분거리</option>
						<option value="30" <%if(model.getSubway3().equals("30분거리")){out.print(" selected='selected' ");} %> >30분거리</option>
						<option value="35" <%if(model.getSubway3().equals("35분거리")){out.print(" selected='selected' ");} %> >35분거리</option>
						<option value="40" <%if(model.getSubway3().equals("40분거리")){out.print(" selected='selected' ");} %> >40분거리</option>
						<option value="45" <%if(model.getSubway3().equals("45분거리")){out.print(" selected='selected' ");} %> >45분거리</option>
					</select>					    
				  </tr>				  
				  <tr>
				    <td class="ac fw bb1 h30 bg_g">대학교</td>
				    <td class="bb1 h30 pl10 ">
					<select name="university1" id="university1" style="width:80px;">
						<option value="">선택</option>
					<%
						for(int i = 0; i < university1List.size(); i++){
							codeModel mode = (codeModel)university1List.get(i);
					%>
					<option value="<%=mode.getCode() %>" <%if(model.getUniversity1().equals(mode.getCode())){out.print(" selected='selected' ");} %>><%=mode.getCodename() %></option>					
					<%
						}
					%>	
					</select>
					&nbsp;
					<span id="divuniversity2">
					<select name="university2" id="divuniversity2" style="width:80px;">
						<option value="선택">선택</option>
					</select>
					</span>
					</td>
				    <td class="ac fw bb1 h30 bg_g">입주가능일</td>
				    <td class="bb1 h30 pl10 ">
					<input type="radio" name="lease" value="즉시입주" <%if(model.getLease().equals("즉시입주") || model.getLease()==""){ %>checked="checked" <%} %> />즉시입주 <br />
					<input type="radio" name="lease" value="입주가능일 지정" <%if(model.getLease().equals("입주가능일 지정")){ %>checked="checked" <%} %> />입주가능일 지정<br />
 
					<select name="leaseyear" style="width:60px;">
						<script type="text/javascript">getYearSelect()</script> 
					</select>
					<select name="leasemonth" style="width:40px;">
						<script type="text/javascript">getMonSelect()</script>
					</select>
					<select name="leaseday" style="width:40px;">
						<script type="text/javascript">getDaySelect()</script>
					</select>
					</td>
				  </tr>				  
				</table>
				</div>			
					
				<br/>
				<div class="list">
				<table  width="167" border="0" cellspacing="0" cellpadding="0">
				  <tr>
				    <td><p class="btn_b87" id="tap03">옵션정보</p></td>
				  </tr>
				</table> 
				<table width="565" border="0" cellspacing="0" cellpadding="0">
				<col width="15%" />
				<col width="35%" />
				<col width="15%" />
				<col width="35%" />
				  <tr>
				     <td class="bt2 bb1 h30 pl10">▶ 난방시설 : 
						<select name="heating" style="width:120px;">
						<%
							for(int i = 0; i < heatingList.size(); i++){
								codeModel mode = (codeModel)heatingList.get(i);
						%>
							<option value="<%=mode.getCode() %>" <%if(model.getHeating().equals(mode.getCode())){out.print(" selected='selected' ");} %>><%=mode.getCodename() %></option>					
						<%
							}
						%>
						</select>
						&nbsp;&nbsp;&nbsp;▶ 냉방시설 : 
						<select name="airconditioning" style="width:120px;">
						<%
						for(int i = 0; i < airconditioningList.size(); i++){
							codeModel mode = (codeModel)airconditioningList.get(i);
						%>
							<option value="<%=mode.getCode() %>" <%if(model.getAirconditioning().equals(mode.getCode())){out.print(" selected='selected' ");} %>><%=mode.getCodename() %></option>					
						<%
						}
						%>
						</select>
						&nbsp;&nbsp;&nbsp;
					</td>
				  </tr>
				  <tr>
				     <td class="bb1 h30 pl10">▶ 가구 : 
					<%
					String[] furniture = model.getFurniture1().split(",");
					for(int i = 0; i < furnitureList.size(); i++){
						codeModel mode = (codeModel)furnitureList.get(i);
						String checked = "";
							for(int j = 0; j<furniture.length; j++){
								if(furniture[j].equals(mode.getCode())){
									checked = " checked='checked' ";
								}
							}
					%>
						<input type="checkbox" name="furniture1" id="furniture1" value="<%=mode.getCode() %>" <%=checked %>/> <%=mode.getCodename() %>				
					<%
					}
					%>	
					</td>
				  </tr>
				  <tr>
				     <td class="bb1 h30 pl10">▶ 가전 : 
					<%
					String[] appliances = model.getAppliances1().split(",");
					for(int i = 0; i < appliancesList.size(); i++){
						codeModel mode = (codeModel)appliancesList.get(i);
						String checked = "";
						for(int j = 0; j<appliances.length; j++){
							if(appliances[j].equals(mode.getCode())){
								checked = " checked='checked' ";
							}
						}
					%>
						<input type="checkbox" name="appliances1" id="appliances1" value="<%=mode.getCode() %>" <%=checked %>/> <%=mode.getCodename() %>				
					<%
					}
					%>	
				     </td>
				  </tr>
				  <tr>
				     <td class="bb1 h30 pl10">▶ 주방/욕실 :  
					<%
						String[] kitchen = model.getKitchen1().split(",");
						for(int i = 0; i < kitchenList.size(); i++){
							codeModel mode = (codeModel)kitchenList.get(i);
							String checked = "";
							for(int j = 0; j<kitchen.length; j++){
								if(kitchen[j].equals(mode.getCode())){
									checked = " checked='checked' ";
								}
							}
					%>
						<input type="checkbox" name="kitchen1" id="kitchen1" value="<%=mode.getCode() %>" <%=checked %>/> <%=mode.getCodename() %>				
					<%
						}
					%>
				     </td>
				  </tr>
				  <tr>
				     <td class="bb1 h30 pl10">▶ 무료 :  
					<%
						String[] security = model.getSecurity1().split(",");
						for(int i = 0; i < securityList.size(); i++){
							codeModel mode = (codeModel)securityList.get(i);
							String checked = "";
							for(int j = 0; j<security.length; j++){
								if(security[j].equals(mode.getCode())){
									checked = " checked='checked' ";
								}
							}
					%>
						<input type="checkbox" name="security1" id="security1" value="<%=mode.getCode() %>" <%=checked %>/> <%=mode.getCodename() %>				
					<%
						}
					%>

					</td>
				  </tr>
				  <!-- tr>
				     <td class="bb1 h30 pl10">▶ 주변시설 :  
					<%
					//	for(int i = 0; i < facilityList.size(); i++){
					//		codeModel mode = (codeModel)facilityList.get(i);
					%>
						<input type="checkbox" name="facility1" id="facility1" value="<%//=mode.getCode() %>" /> <%//=mode.getCodename() %>				
					<%
					//	}
					%> 
					</td>
				  </tr -->
				</table>
				</div>
				<br/>
				
				<div class="list">
				<table  width="167" border="0" cellspacing="0" cellpadding="0">
				  <tr>
				    <td><p class="btn_b87" id="tap03">소개</p></td>
				  </tr>
				</table> 
				<table width="565" border="0" cellspacing="0" cellpadding="0">
				<col width="15%" />
				<col width="35%" />
				<col width="15%" />
				<col width="35%" />
				  <tr>
				    <td class="ac fw bt2 bb1 h30 bg_g">제목</td>
				    <td colspan="3" class="bt2 bb1 h30 pl10 ">
				    <input name="title" id="title" value="" title="제목" type="text"  style="width:300px;" maxlength="20"/>
				    </tr>
				  <tr>
				    <td class="ac fw bb1 h30 bg_g">작성자</td>
				    <td class=" bb1 h30 pl10"><%=(String)session.getAttribute("name") %><input name="person" id="person" value="<%=(String)session.getAttribute("name") %>" title="담당자" type="hidden"  style="width:80px;" /></td>
				     <td class="ac fw bb1 h30 bg_g">연락처</td>
				    <td class="ac bb1 h30">
			<%		
				if (session.getAttribute("hp") != null){
					String hp = (String)session.getAttribute("hp");
					if(hp.length() > 10){ %> 				     
				    <input name="tel1" id="tel1" value="<%=hp.substring(0,3)%>" title="연락처1" type="text"  style="width:25px;" maxlength="3"/> -
					<input name="tel2" id="tel2" value="<%=hp.substring(3,7)%>" title="연락처2" type="text"  style="width:30px;" maxlength="4"/> - 
					<input name="tel3" id="tel3" value="<%=hp.substring(7,hp.length()) %>" title="연락처3" type="text"  style="width:30px;" maxlength="4"/>
			<%		}else{ %>					
				    <input name="tel1" id="tel1" value="<%=hp.substring(0,3)%>" title="연락처1" type="text"  style="width:25px;" maxlength="3"/> -
					<input name="tel2" id="tel2" value="<%=hp.substring(3,6)%>" title="연락처2" type="text"  style="width:30px;" maxlength="4"/> - 
					<input name="tel3" id="tel3" value="<%=hp.substring(6,hp.length()) %>" title="연락처3" type="text"  style="width:30px;" maxlength="4"/>
			<%		} 
				}
			%>					
					</td>
				  </tr>
				  <tr>
				     <td colspan="4" class="bb1 h30 pl10 lh pt10 pb10">
					<!--  textarea name="content" style="width:500px; height:300px;"></textarea>-->
						<iframe width="500px" height="376" id="edit_frame" name="edit_frame" scrolling="no" frameborder="0" marginheight="0" marginwidth="0" src="/editor/editor.htm"></iframe>
					<textarea rows="10" style="display:none;width:500px; height:300px;"  name="editorContents"><%=model.getContent()== null ? "" :model.getContent() %></textarea>  					
					</td>
				   </tr>				  
				</table>
				</div>
				<br/>	
				
				<div class="list">
				<div><img src="/room/img/tab_option.gif"  /><!-- 사진등록 --></div>
				<table width="565" border="0" cellspacing="0" cellpadding="0">
				<col width="50%" />
				<col width="50%" />

				     <%if(gubun.equals("CI")){ %>
				     <input type="hidden" name="continuously" value="Y" />
				  <tr>
				     <td class="bt2 bb1 h30 pl10">&nbsp;
					<input type="hidden" name="photo1" id="photo1" value="<%=model.getPhoto1()%>"/> 
					<input type="hidden" name="photo1_small" id="photo1_small" value="<%=model.getPhoto1_small()%>"/> 
					<input type="hidden" name="photo1_big" id="photo1_big" value="<%=model.getPhoto1_big()%>"/> 
					<input type="hidden" name="photo1_main" value="<%=model.getPhoto1_main()%>" />
				    <img src="/download/<%=model.getPhoto1_small() %>?name=<%=model.getPhoto1_small() %>&kind=img" width="100" height="50"/>					
					</td>
				     <td class="bt2 bb1 h30 pl10">&nbsp;
					<input type="hidden" name="photo2" id="photo2" value="<%=model.getPhoto2()%>"/> 
					<input type="hidden" name="photo2_small" id="photo2_small" value="<%=model.getPhoto2_small()%>"/> 
					<input type="hidden" name="photo2_big" id="photo2_big" value="<%=model.getPhoto2_big()%>"/> 					
				    <img src="/download/<%=model.getPhoto2_small() %>?name=<%=model.getPhoto2_small() %>&kind=img" width="100" height="50"/>
					</td>					
				  </tr>
				  <tr>
				     <td class="bb1 h30 pl10">&nbsp;
					<input type="hidden" name="photo3" id="photo3" value="<%=model.getPhoto3()%>"/>
					<input type="hidden" name="photo3_small" id="photo3_small" value="<%=model.getPhoto3_small()%>"/> 
					<input type="hidden" name="photo3_big" id="photo3_big" value="<%=model.getPhoto3_big()%>"/>					 
				    <img src="/download/<%=model.getPhoto3_small() %>?name=<%=model.getPhoto3_small() %>&kind=img" width="100" height="50"/>
					</td>	
				     <td class="bb1 h30 pl10">&nbsp;
					<input type="hidden" name="photo4" id="photo4" value="<%=model.getPhoto4()%>"/> 
					<input type="hidden" name="photo4_small" id="photo4_small" value="<%=model.getPhoto4_small()%>"/> 
					<input type="hidden" name="photo4_big" id="photo4_big" value="<%=model.getPhoto4_big()%>"/>					
				    <img src="/download/<%=model.getPhoto4_small() %>?name=<%=model.getPhoto4_small() %>&kind=img" width="100" height="50"/>
					</td>	
				  </tr>
				  <tr>				  
				     <td class="bb1 h30 pl10">&nbsp;
					<input type="hidden" name="photo5" id="photo5" value="<%=model.getPhoto5()%>"/> 
					<input type="hidden" name="photo5_small" id="photo5_small" value="<%=model.getPhoto5_small()%>"/> 
					<input type="hidden" name="photo5_big" id="photo5_big" value="<%=model.getPhoto5_big()%>"/>					
				    <img src="/download/<%=model.getPhoto5_small() %>?name=<%=model.getPhoto5_small() %>&kind=img" width="100" height="50"/>
					</td>
				     <td class="bb1 h30 pl10">&nbsp;
					<input type="hidden" name="photo6" id="photo6" value="<%=model.getPhoto6()%>"/> 
					<input type="hidden" name="photo6_small" id="photo6_small" value="<%=model.getPhoto6_small()%>"/> 
					<input type="hidden" name="photo6_big" id="photo6_big" value="<%=model.getPhoto6_big()%>"/>					
				    <img src="/download/<%=model.getPhoto6_small() %>?name=<%=model.getPhoto6_small() %>&kind=img" width="100" height="50"/>
					</td>	
				  </tr>	
				    <%}else{ %>
				  <tr>
				     <td class="bt2 bb1 h30 pl10">&nbsp;
					<input type="file" name="photo1" id="photo1" style="width:265px;" /> <input type="radio" name="photo1_main" value="1" checked="checked"/> 메인
					</td>
				     <td class="bt2 bb1 h30 pl10">&nbsp;
					<input type="file" name="photo2" id="photo2" style="width:265px;" /> <input type="radio" name="photo1_main" value="2"/> 메인
					</td>					
				  </tr>
				  <tr>
				     <td class="bb1 h30 pl10">&nbsp;
					<input type="file" name="photo3" id="photo3" style="width:265px;" /> <input type="radio" name="photo1_main" value="3"/> 메인
					</td>
				     <td class="bb1 h30 pl10">&nbsp;
					<input type="file" name="photo4" id="photo4" style="width:265px;" /> <input type="radio" name="photo1_main" value="4"/> 메인

					</td>
				  </tr>
				  <tr>				  
				     <td class="bb1 h30 pl10">&nbsp;
					<input type="file" name="photo5" id="photo5" style="width:265px;" /> <input type="radio" name="photo1_main" value="5"/> 메인
					</td>
				     <td class="bb1 h30 pl10">&nbsp;
					<input type="file" name="photo6" id="photo6" style="width:265px;" /> <input type="radio" name="photo1_main" value="6"/> 메인
					</td>
				  </tr>					     
					<%} %>				     				  			  
				</table>
				</div>
				<br/>	 

				<!-- 실제적인 리스트 끝 -->
			<table border="0" cellspacing="0" cellpadding="0">
			  <tr>
			    <td style="padding-left:10px;">
				  <a class="d" href="#"  onclick="goWrite('CI');"><div class="btn_b67">계속등록</div></a>
				</td>
			    <td style="padding-left:10px;">
				  <a class="d" href="#"  onclick="goWrite('I');"><div class="btn_b47">등록</div></a>
				</td>
			    <td style="padding-left:10px;">
				  <a class="d" href="#" id="btList"><div class="btn_b47">목록</div></a>
				</td>
			  </tr>
			</table>				
				</form>
</div>
</div>
<!----------------오른쪽 시작---------------->  
<%@ include file="/room/common/right.jsp" %>  
<!----------------오른쪽 끝---------------->
</div>


<!-------------푸터영역----------> 
<%@ include file="/room/common/footer.jsp" %> 
<!-------------푸터영역----------> 
<script type="text/javascript">
swfobject.registerObject("FlashID");
</script>
</body>
</html>